{% set pypi_name = 'os-ken' %}
{% set upstream_version = upstream_version('1.3.0') %}
{% set rpm_release = '0' %}
{% set source = url_pypi() %}
Name:           {{ py2name('os-ken') }}
Epoch:          {{ epoch('os-ken') }}
Version:        {{ py2rpmversion() }}
Release:        {{ py2rpmrelease() }}
Summary:        A component-based software defined networking framework in OpenStack
License:        {{ license('Apache-2.0') }}
Group:          Development/Languages/Python
URL:            https://docs.openstack.org/{{ pypi_name }}
Source0:        {{ source }}
BuildRequires:  openstack-macros
BuildRequires:  {{ py3('Routes') }}
BuildRequires:  {{ py3('WebOb') }}
BuildRequires:  {{ py3('eventlet') }}
BuildRequires:  {{ py3('lxml') }}
BuildRequires:  {{ py3('mock') }}
BuildRequires:  {{ py3('msgpack') }}
BuildRequires:  {{ py3('netaddr') }}
BuildRequires:  {{ py3('nose') }}
BuildRequires:  {{ py3('oslo.config') }}
BuildRequires:  {{ py3('oslotest') }}
BuildRequires:  {{ py3('ovs') }}
BuildRequires:  {{ py3('pbr') }}
BuildRequires:  {{ py3('six') }}
BuildRequires:  {{ py3('stestr') }}
BuildRequires:  {{ py3('tinyrpc') }}
BuildArch:      noarch

%description
A component-based software defined networking framework in OpenStack.
This is a fork of the Ryu library tailored for OpenStack Neutron.

%package -n {{ py2name(py_versions='py3') }}
Summary:        A component-based software defined networking framework in OpenStack
Requires:       {{ py3('Routes') }}
Requires:       {{ py3('WebOb') }}
Requires:       {{ py3('eventlet') }}
Requires:       {{ py3('msgpack') }}
Requires:       {{ py3('netaddr') }}
Requires:       {{ py3('oslo.config') }}
Requires:       {{ py3('ovs') }}
Requires:       {{ py3('pbr') }}
Requires:       {{ py3('six') }}
Requires:       {{ py3('tinyrpc') }}

%description -n {{ py2name(py_versions='py3') }}
A component-based software defined networking framework in OpenStack.
This is a fork of the Ryu library tailored for OpenStack Neutron.

This package contains the Python 3.x module.

%package -n python-osken-doc
Summary:        A component-based software defined networking framework in OpenStack - Documentation
Group:          Documentation/HTML
BuildRequires:  {{ py3('Sphinx') }}
BuildRequires:  {{ py3('openstackdocstheme') }}

%description -n python-osken-doc
A component-based software defined networking framework in OpenStack.
This is a fork of the Ryu library tailored for OpenStack Neutron.

This package contains the documentation.

%prep
%autosetup -p1 -n {{ pypi_name }}-{{ upstream_version }}
%py_req_cleanup

%build
%{py3_build}
PBR_VERSION=%{version} %sphinx_build -b html doc/source doc/build/html
rm -rf doc/build/html/.{doctrees,buildinfo}

%install
%{py3_install}

%check
PYTHON=python3 ./run_tests.sh -N -P

%files -n {{ py2name(py_versions='py3') }}
%doc README.rst ChangeLog
%license LICENSE
%{python3_sitelib}/os_ken*
%{python3_sitelib}/*.egg-info
%{_bindir}/osken
%{_bindir}/osken-manager

%files -n python-osken-doc
%doc doc/build/html
%license LICENSE

%changelog
